#include <bits/stdc++.h>
#define ls(u) tr[u].ls
#define rs(u) tr[u].rs
#define INF 1000000001
#define N 150005
using namespace std;
typedef long long ll;

int n, m, Q, a[N];
ll b[N];

int main ()
{
    freopen("clear.in", "r", stdin);
    freopen("clear.out", "w", stdout);

    scanf("%d %d %d", &n, &m, &Q);
    for (int i=1; i<=n; i++) { scanf("%d", &a[i]); }
    for (int t=1; t<=Q; t++) {
        int l, r; scanf("%d %d", &l, &r);
        
        b[l-1]=0;
        for (int i=l; i<=r; i++) { b[i]=a[i]; }
        for (int i=r; i>=l; i--) { b[i]-=b[i-1]; }
        b[r+1]=-INF;

        ll ans=0;
        for (int i=1; i<=n; i++) {
            for (int j=i+1; j<=min(r+1, i+m) && b[i]>0; j++) {
                int cur=min(b[i], -b[j]);
                if (b[j]<0) { b[i]-=cur; b[j]+=cur; ans+=cur; }
            }
            if (b[i]>0) { b[min(r+1, i+m)]+=b[i]; ans+=b[i]; b[i]=0; }
        }
        printf("%lld\n", ans);
    }

    return 0;
}